import http from '../http'

/**
 * 优惠卷
 */
function couponAdd(data: any) {
  return http.post('/coupon/api/v1/coupon/add', data)
}
/**
 * 用户优惠卷
 */
function userCouponAdd(data: any) {
  return http.post('/coupon/api/v1/user/coupon/add', data)
}
function userCouponList(data: any) {
  return http.get('/coupon/api/v1/user/coupon/list', data)
}

/**
 * 抽奖功能相关
 */
// 获取抽奖功能的开启或关闭状态
function handleGetDrawOpenStatusApi(data: any) {
  return http.get('/coupon/api/v1/turntable/info', data)
}
// 修改抽奖功能的开启或关闭状态
function handleUpDrawOpenStatusApi(data: any) {
  return http.post('/coupon/api/v1/turntable/addOrUpdate', data)
}
// 获取奖品列表
function handleGetPrizeListAPi(data: any) {
  return http.get('/coupon/api/v1/prize/list', data)
}
// 新增奖品
function handleAddPrizeApi(data: any) {
  return http.post('/coupon/api/v1/prize/add', data)
}
// 修改奖品
function handleUpPrizeApi(data: any) {
  return http.post('/coupon/api/v1/prize/update', data)
}
// 获取中奖奖品
function handleGetWinPrizeApi(data: any) {
  return http.post('/coupon/api/v1/prize/takeAward', data)
}
// 获取中奖记录列表
function handleGetWinPrizeRecordListApi(data: any) {
  return http.get('/coupon/api/v1/user/turntable/flow/list', data)
}

export default {
  couponAdd,
  userCouponAdd,
  userCouponList,
  handleGetDrawOpenStatusApi,
  handleUpDrawOpenStatusApi,
  handleGetPrizeListAPi,
  handleAddPrizeApi,
  handleUpPrizeApi,
  handleGetWinPrizeApi,
  handleGetWinPrizeRecordListApi
}
